var pesubitems = 1;

demos.PE = Ext.extend(Ext.Panel, {
	title: 'PE',
    id: 'pe',
    fullscreen: true,
    cardSwitchAnimation: 'slide',
    iconCls: 'iconPE',
//    layout: 'fit',
    centered: true,
    scroll: 'vertical',
//    floating: true,
//    modal: true,
    initComponent: function() {
/*        Ext.apply(this, {
                dockedItems: [
                { xtype: 'toolbar',
                dock: 'top',
                title: 'Patient',
                centered: true,
			items: [{
                        text: 'back',
                        ui: 'back',
                        handler: function() {
                            if (Ext.is.Phone) demos.Tabcontrol.tabBar.setVisible(true);
                            sink.Main.ui.setActiveItem(demos.Maincontrol, {type: 'slide', direction: 'right'});
                            sink.Main.ui.currentCard = demos.Maincontrol;
//                            demos.Tabcontrol.tabBar.setActiveItem('patients', {type: 'slide', direction: 'right'})
                        }
                    }, {
                        xtype: 'spacer'
                    }, {
                        text: 'save',
                        ui: 'confirm',		
                        handler: function() {
                            var patientbadge = demos.patientscard.tab;
                            badgeNumber = parseInt(patientbadge.badgeText);
                            nextNumber = isNaN(badgeNumber) ? '' : badgeNumber-1;
                            patientbadge.setBadge(nextNumber);
//  KR                            ROSpanel.btnCount = 0;;
//                            Ext.getCmp('const1').setBadge('');
//  KR                          if (ToolbarDemo.isPhone()) ToolbarDemo.views.viewport.tabBar.setVisible(true);
//  KR                          ToolbarDemo.views.viewport.remove(ToolbarDemo.views.viewport.getActiveItem());
//  KR                          ToolbarDemo.views.viewport.setActiveItem('patients', {type: 'slide', direction: 'right'})
                        }
                    }]
                }]
        }); */
	      Ext.apply(this, {
			fullscreen: true,
			scroll: 'vertical',
			dock: 'top',
            cls: 'pe_checkbox',
			items: [
				new demos.PEpanel({
					ui: 'light',
				    id: 'constpepanel',
				    PESubItems: 1,
					PEtitle: [{
				        id: 'constpe',
				        name: 'constpe',
			            text: 'Constitutional',
				    }],
				    PEitems: [{
			            id: 'wdwn',
			            name: 'wdwn',
			            label: 'WDWN',
			        }, {
			            id: 'obese',
			            name: 'obese',
			            label: 'Obese',
			        }, {
			            id: 'thin',
			            name: 'thin',
			            label: 'Thin',
			        }, {
			            id: 'cachetic',
			            name: 'cachetic',
			            label: 'Cachetic',
			        }, {
			            id: 'wellgrmd',
			            name: 'wellgrmd',
			            label: 'Well Groomed',
					}],
				}),
				new demos.PEpanel({
					ui: 'dark',
				    id: 'eyespepanel',
				    PESubItems: 2,
					PEtitle: [{
				        id: 'eyespe',
				        name: 'eyespe',
			            text: 'Eyes',
				    }],
				    PEitems: [{
			            id: 'conjunctwnl',
			            name: 'conjunctwnl',
			            label: 'Conjunct. WNL',
			        }, {
			            id: 'lidswnl',
			            name: 'lidswnl',
			            label: 'Lids WNL',
					}],
				    PEitems2: [{
			            id: 'perrl',
			            name: 'perrl',
			            label: 'PERRL',
					}]
				}),
				new demos.PEpanel({
					ui: 'light',
				    id: 'entpepanel',
				    PESubItems: 3,
					PEtitle: [{
				        id: 'entpe',
				        name: 'entpe',
			            text: 'E/N/M/Throat',
				    }],
				    PEitems: [{
			            id: 'extinsppe',
			            name: 'extinsppe',
			            label: 'Ext. Inspect',
			        }, {
			            id: 'sinusten',
			            name: 'sinusten',
			            label: 'Sinus Tender',
					}],
				    PEitems2: [{
			            id: 'hearwnl',
			            name: 'hearwnl',
			            label: 'Hearing WNL',
			        }, {
			            id: 'heardim',
			            name: 'heardim',
			            label: 'Hearing Dim.',
					}],
				    PEitems3: [{
			            id: 'lipsgums',
			            name: 'lipsgums',
			            label: 'Lips/Gums WNL',
			        }, {
			            id: 'teethwnl',
			            name: 'teethwnl',
			            label: 'Teeth WNL',
			        }, {
			            id: 'poordent',
			            name: 'poordent',
			            label: 'Poor Dentition',
			        }, {
			            id: 'edent',
			            name: 'edent',
			            label: 'Edentulous',
					}]
				}),
				new demos.PEpanel({
					ui: 'dark',
				    id: 'neckpepanel',
				    PESubItems: 2,
					PEtitle: [{
				        id: 'neckpe',
				        name: 'neckpe',
			            text: 'Neck',
				    }],
				    PEitems: [{
			            id: 'supple',
			            name: 'supple',
			            label: 'Supple',
			        }, {
			            id: 'nomasses',
			            name: 'nomasses',
			            label: 'No Masses',
			        }, {
			            id: 'symmetric',
			            name: 'symmetric',
			            label: 'Symmeterical',
			        }, {
			            id: 'trachmid',
			            name: 'trachmid',
			            label: 'Trach midline',
					}],
				    PEitems2: [{
			            id: 'thyrownl',
			            name: 'thyrownl',
			            label: 'Thyroid WNL',
			        }, {
			            id: 'thyroenl',
			            name: 'thyroenl',
			            label: 'Thyroid Enl.',
			        }, {
			            id: 'thyromass',
			            name: 'thyromassl',
			            label: 'Thyroid Mass',
					}]
				}),
				new demos.PEpanel({
					ui: 'light',
				    id: 'resppepanel',
				    PESubItems: 4,
					PEtitle: [{
				        id: 'resppe',
				        name: 'resppe',
			            text: 'Respiratory',
				    }],
				    PEitems: [{
			            id: 'respeven',
			            name: 'respeven',
			            label: 'Rsp. Evn. Unlbrd',
				    }],
				    PEitems2: [{
			            id: 'percuswnl',
			            name: 'percuswnl',
			            label: 'Percussion WNL',
				    }],
				    PEitems3: [{
			            id: 'tactwnl',
			            name: 'tactwnl',
			            label: 'Tactile frem. WNL',
				    }],
				    PEitems4: [{
			            id: 'bsclear',
			            name: 'bsclear',
			            label: 'BS Clear',
				    }, {
			            id: 'decsounds',
			            name: 'decsounds',
			            label: 'Dec. Sounds',
				    }, {
			            id: 'wheezes',
			            name: 'wheezes',
			            label: 'Wheezes',
				    }, {
			            id: 'crackles',
			            name: 'crackles',
			            label: 'Crackles',
					}]
				}),
				new demos.PEpanel({
					ui: 'dark',
				    id: 'cardiopepanel',
				    PESubItems: 7,
					PEtitle: [{
				        id: 'cardiope',
				        name: 'cardiope',
			            text: 'Cardiovascular',
				    }],
				    PEitems: [{
			            id: 'palpit',
			            name: 'palpit',
			            label: 'Palpit. WNL',
				    }],
				    PEitems2: [{
			            id: 'rrr',
			            name: 'rrr',
			            label: 'RRR',
				    }],
				    PEitems3: [{
			            id: 'carartwnl',
			            name: 'carartwnl',
			            label: 'Carotid Art. WNL',
				    }],
				    PEitems4: [{
			            id: 'adbaorta',
			            name: 'adbaorta',
			            label: 'Abdom. Aorta NORM',
				    }, {
			            id: 'noabdombr',
			            name: 'noabdombr',
			            label: 'No Abdom. Bruise',
					}],
				    PEitems5: [{
			            id: 'femartwnl',
			            name: 'femartwnl',
			            label: 'Fem. Art. WNL',
				    }],
				    PEitems6: [{
			            id: 'pedalpulse',
			            name: 'pedalpulse',
			            label: 'Pedal Pulse',
				    }],
				    PEitems7: [{
			            id: 'noedema',
			            name: 'noedema',
			            label: 'No Edema',
				    }]
				})
			]
	      });
	      demos.PE.superclass.initComponent.apply(this, arguments);
      }
});

Ext.reg('pe', demos.PE);
